#ifndef YUVLOADER_H
#define YUVLOADER_H

#include <QObject>
#include <QFile>
#include <QDataStream>
#include <QTimer>

class QVideoFrame;
class YUVLoader : public QObject
{
    Q_OBJECT
public:
    explicit YUVLoader(QObject *parent = nullptr);
    ~YUVLoader();
    void GetFrame(quint8 *dataY, quint8 *dataU, quint8 *dataV, quint32 linesizeY, quint32 linesizeU, quint32 linesizeV);

public slots:
    void onFrameTimer();

signals:
    void newFrameAvailable(const QVideoFrame& frame);

private:
    QFile m_file;
    QDataStream m_stream;
    QTimer m_frameTimer;
};

#endif // YUVLOADER_H
